var app = getApp();
Page({
  data: {
    boo: !1,
    proList: "",
    maBoo: !0,
    noFlag: !1,
    imageArr: [
    ],
    bigMask:false
  },
  onLoad: function () {
    wx.createCanvasContext("myQrcode");
    var bgc = wx.getStorageSync('color')
    wx.setNavigationBarColor({
      frontColor: "#ffffff",
      backgroundColor: bgc,
    })
    this.setData({
      backgroundColor: bgc
    })
  },
  ma: function () {
    var t = !this.data.maBoo;
    this.setData({
      maBoo: t
    }), drawQrcode({
      width: 200,
      height: 200,
      canvasId: "myQrcode",
      text: "15210865395"
    });
  },
  onShareAppMessage: function (t) {
    return a.globalData.share;
  },
  onShow: function () {
    this.getBase()
    this.getallgoods()
    var that = this
    var openid = wx.getStorageSync('openid')
    console.log(openid)
    if (openid) {
      that.setData({
        bigMask: true
      })
    } else {
      that.setData({
        bigMask: false
      })
    }
  },
  onReady: function () {
    this.getallgoods()
    this.getBase()
  },
  onPullDownRefresh: function () {
    var that = this;
    wx.showNavigationBarLoading(), app.util.request({
      url: "entry/wxapp/Goods.listgoods",
      success: function (res) {
        console.log(res)
        var proList = res.data
        that.setData({
          proList: proList
        })
      },
    });
  },
  getallgoods: function () {
    var that = this
    app.util.request({
      url: "entry/wxapp/Goods.listgoods",
      success: function (res) {
        console.log(res)
        var proList = res.data
        that.setData({
          proList: proList
        })
      },
    });
  },
  getBase: function () {
    var that = this
    app.util.request({
      'url': 'entry/wxapp/Index.base',
      'cachetime': '30',
      success: function (res) {
        console.log(res)
        var imageArr = res.data
        that.setData({
          imageArr: imageArr
        })
      }
    })
  },
  toast: function () {
    wx.redirectTo({
      url: '/hyb_yl/tabBar/index/index'
    })
  },
  toast1: function (e) {
    //console.log(e)
    wx.redirectTo({
      url: '/hyb_yl/tabBar/community/community'
    })
  },
  toast2: function () {
    wx.redirectTo({
      url: '/hyb_yl/mysubpages/pages/shop/shop'
    })
  },
  toast3: function () {
    wx.redirectTo({
      url: '/hyb_yl/tabBar/my/my'
    })
  },
  toast4() {
    wx.redirectTo({
      url: '/hyb_yl/userLife/pages/jibingyufang/jibingyufang?biaoti2=资讯'
    })
  },
});